home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 May: Tool Chest / Dev.CD May 98 TC.toast / Tool Chest / Development Kits / HyperCard Related / APDA HyperCard Toolkits / HyperCard Video Toolkit 2.0 / HVT #2 / Advanced Material / Video Sources / videoFramesPerSecond.p < prev    next >
Encoding:
Text File  |  1995-02-07  |  1.8 KB  |  79 lines  |  [TEXT/MPS ]

  1. (*
  2.     videoFramesPerSecond fr - Set the playing speed for the next playVideo command.
  3.  
  4.     To compile and link this file using Macintosh Programmer's Workshop,
  5.  
  6.         pascal -w videoFramesPerSecond.p
  7.  
  8.         link -m ENTRYPOINT -o HyperCommands -rt XCMD=8010 -sn Main=videoFramesPerSecond ∂
  9.             videoFramesPerSecond.p.o "{MPW}"Libraries:interface.o "{MPW}"PLibraries:PasLib.o
  10.  
  11.     Copyright © 1988 Apple Computer, Inc.
  12.  
  13.     2/88 - Initial coding by Harry R. Chesley.
  14. *)
  15.  
  16. {$R-}
  17.  
  18. {$S videoFramesPerSecond }     { Segment name must be the same as the command name. }
  19.  
  20. unit DummyUnit;
  21.  
  22. interface
  23.  
  24. uses MemTypes, QuickDraw, OSIntf, HyperXCmd;
  25.  
  26. procedure EntryPoint(paramPtr: XCmdPtr);
  27.     
  28. implementation
  29.  
  30. type
  31.  
  32. Str31 = String[31];
  33.  
  34. procedure videoFramesPerSecond(paramPtr: XCmdPtr); forward;
  35.  
  36. procedure EntryPoint(paramPtr: XCmdPtr);
  37.  
  38.     begin
  39.         videoFramesPerSecond(paramPtr);
  40.     end;
  41.  
  42. procedure videoFramesPerSecond(paramPtr: XCmdPtr);
  43.  
  44.     var speed: str255;
  45.  
  46.     {$I XCmdGlue.inc}
  47.  
  48.     procedure Fail(errMsg: Str255); { set theResult and quit }
  49.         begin
  50.             paramPtr^.returnValue := PasToZero(errMsg);
  51.             exit(videoFramesPerSecond);
  52.         end;
  53.  
  54.     {$I VideoUtil.inc}
  55.  
  56.     begin
  57.         if paramPtr^.paramCount <> 1 then Fail('parameter count is not 1');
  58.  
  59.         GetStrParm(1,speed);
  60.  
  61.         { Set the defaults. }
  62.         if StringEqual(speed,'slowest') then speed := '1'
  63.         else if StringEqual(speed,'slower') then speed := '10'
  64.         else if StringEqual(speed,'slow') then speed := '15'
  65.         else if StringEqual(speed,'normal') then speed := '30'
  66.         else if StringEqual(speed,'fast') then speed := '60'
  67.         else if StringEqual(speed,'faster') then speed := '90'
  68.         else if StringEqual(speed,'fastest') then speed := '120';
  69.  
  70.         { Set the global that specifies the speed. }
  71.         SetStrGlobal('videoSpeed',speed);
  72.  
  73.         { Now let the play change all this if it wants to. }
  74.         GetStrParm(1,speed);
  75.         videoCmd('fps',speed);
  76.     end;
  77.  
  78. end.
  79.